package com.nimitz.modules.approval.service.impl;


import com.nimitz.modules.approval.domain.ApprovalProcedureNode;
import com.nimitz.modules.approval.mapper.ApprovalProcedureNodeMapper;
import com.nimitz.modules.approval.service.IApprovalProcedureNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ApprovalProcedureNodeServiceImpl
 * @Author FuCun
 * @Date 2021-08-17-14:45
 * @PackageName com.nimitz.modules.approval.service.impl
 * @Description 审批流节点明细-实现
 * @Version 1.0.0
 */
@Service
public class ApprovalProcedureNodeServiceImpl implements IApprovalProcedureNodeService {

    @Autowired
    private ApprovalProcedureNodeMapper approvalProcedureNodeMapper;
    /**
     * 查询所有审批流节点明细（含搜索）
     *
     * @param  ApprovalProcedureNode 审批流节点明细
     * @return 审批流节点明细集合
     */
    @Override
    public List<ApprovalProcedureNode> selectApprovalProcedureNodeList(ApprovalProcedureNode ApprovalProcedureNode) {
        return approvalProcedureNodeMapper.selectApprovalProcedureNodeList(ApprovalProcedureNode);
    }

    /**
     * 新增审批流节点明细信息
     *
     * @param ApprovalProcedureNode 审批流节点明细
     * @return 结果
     */
    @Override
    public int insertApprovalProcedureNode(ApprovalProcedureNode ApprovalProcedureNode) {
        return approvalProcedureNodeMapper.insertApprovalProcedureNode(ApprovalProcedureNode);
    }

    /**
     * 修改审批流节点明细信息
     *
     * @param ApprovalProcedureNode 审批流节点明细
     * @return 结果
     */
    @Override
    public int updateApprovalProcedureNode(ApprovalProcedureNode ApprovalProcedureNode) {
        return approvalProcedureNodeMapper.updateApprovalProcedureNode(ApprovalProcedureNode);
    }

    /**
     * 删除审批流节点明细信息
     *
     * @param procedureNodeId 流节点明细id
     * @return 结果
     */
    @Override
    public int deleteApprovalProcedureNodeByProcedureId(Long procedureNodeId) {
        return approvalProcedureNodeMapper.deleteApprovalProcedureNodeByProcedureId(procedureNodeId);
    }

    /**
     * 校验审批流节点名称是否唯一
     *
     * @param procedureNodeName 审批流节点名称
     * @return 结果
     */
    @Override
    public ApprovalProcedureNode checkApprovalProcedureNodeNameUnique(String procedureNodeName) {
        return approvalProcedureNodeMapper.checkApprovalProcedureNodeNameUnique(procedureNodeName);
    }
}
